Skip to content

[DRAFT] make panic overflow messages include values#154231

Draft
asquared31415 wants to merge 3 commits intorust-lang:mainfrom
asquared31415:panic_overflow_msg
Draft

[DRAFT] make panic overflow messages include values#154231
asquared31415 wants to merge 3 commits intorust-lang:mainfrom
asquared31415:panic_overflow_msg

Conversation

@asquared31415
Copy link
Copy Markdown
Contributor

@asquared31415 asquared31415 commented Mar 22, 2026

Changes the panic overflow messages at runtime from the form "attempted to add with overflow" to be more like the const eval overflow messages: "attempt to compute `200 + 100` which would overflow".

Needs perf run to evaluate binary size and compile time impact.

Also should probably implement some of the other overflow panic messages, such as unary negation, and maybe div/rem by 0 (though that one is probably less useful)

r? @Mark-Simulacrum

I have a couple different ideas for implementations if the impact is too bad. I could either make the functions generic and instantiate them in core, or manually make a function that takes every int pair (panic_add_overflow_u8, panic_add_overflow_u16, ...) if the generics are causing the functions to get included in downstream crates.

ref https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/Improved.20Overflow.20Panic.20Messages

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Mar 22, 2026
@asquared31415 asquared31415 marked this pull request as draft March 22, 2026 22:30
@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 22, 2026
@Mark-Simulacrum
Copy link
Copy Markdown
Member

Generics + inline(never) share the upstream instantiation as long as there is one, so you shouldn't need the full set of functions. I suspect extending to 128-bits is going to be too much impact (64 bits would probably be close to free, but 128 seems likely to not be).

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors

This comment has been minimized.

rust-bors bot pushed a commit that referenced this pull request Mar 22, 2026
[DRAFT] make panic overflow messages include values
@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Mar 22, 2026
@asquared31415
Copy link
Copy Markdown
Contributor Author

Agreed, the extension to 128 bit was part that I liked least about this implementation.

If the binary size impact of actually doing the calls is bad, I also might try providing a 64 or even 32 bit version (but not 8 or 16) and only extend up to the smallest size necessary for the actual type. Then for the majority of cases it could be one native register per argument, instead of 2 registers per argument in every case.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors bot commented Mar 23, 2026

☀️ Try build successful (CI)
Build commit: 9e39c5f (9e39c5fc8fae48cd572a06933d96a5cae9065ae2, parent: 562dee4820c458d823175268e41601d4c060588a)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (9e39c5f): comparison URL.

Overall result: ❌✅ regressions and improvements - please read the text below

Benchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf.

Next Steps: If you can justify the regressions found in this try perf run, please do so in sufficient writing along with @rustbot label: +perf-regression-triaged. If not, please fix the regressions and do another perf run. If its results are neutral or positive, the label will be automatically removed.

@bors rollup=never
@rustbot label: -S-waiting-on-perf +perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
1.4% [0.1%, 2.9%] 14
Regressions ❌
(secondary)
0.7% [0.2%, 1.1%] 4
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.3% [-0.3%, -0.3%] 3
All ❌✅ (primary) 1.4% [0.1%, 2.9%] 14

Max RSS (memory usage)

Results (primary -1.6%, secondary 0.2%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
2.1% [2.1%, 2.1%] 1
Regressions ❌
(secondary)
1.0% [0.8%, 1.2%] 2
Improvements ✅
(primary)
-3.5% [-6.4%, -0.6%] 2
Improvements ✅
(secondary)
-1.3% [-1.3%, -1.3%] 1
All ❌✅ (primary) -1.6% [-6.4%, 2.1%] 3

Cycles

Results (primary 2.3%, secondary -0.3%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
2.3% [1.9%, 2.7%] 2
Regressions ❌
(secondary)
6.7% [6.7%, 6.7%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-3.7% [-5.4%, -2.0%] 2
All ❌✅ (primary) 2.3% [1.9%, 2.7%] 2

Binary size

Results (primary 0.1%, secondary 0.1%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
0.1% [0.0%, 0.3%] 35
Regressions ❌
(secondary)
0.1% [0.0%, 0.1%] 8
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.0% [-0.0%, -0.0%] 1
All ❌✅ (primary) 0.1% [0.0%, 0.3%] 35

Bootstrap: 485.484s -> 488.066s (0.53%)
Artifact size: 394.88 MiB -> 394.85 MiB (-0.01%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Mar 23, 2026
@rust-log-analyzer
Copy link
Copy Markdown
Collaborator

The job x86_64-gnu-miri failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
tests/panic/function_calls/exported_symbol_good_unwind.rs ... ok
tests/panic/panic1.rs ... ok

FAILED TEST: tests/panic/overflowing-lsh-neg.rs
command: MIRI_ENV_VAR_TEST="0" MIRI_TEMP="/tmp/miri-uitest-zXyPI4" RUST_BACKTRACE="1" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/miri" "--error-format=json" "--sysroot=/checkout/obj/build/x86_64-unknown-linux-gnu/miri-sysroot" "-Dwarnings" "-Dunused" "-Ainternal_features" "-Zui-testing" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/tmp/miri_ui/0/tests/panic" "tests/panic/overflowing-lsh-neg.rs" "--extern" "cfg_if=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libcfg_if-5e6b4ab63bd29e1f.rlib" "--extern" "cfg_if=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libcfg_if-5e6b4ab63bd29e1f.rmeta" "--extern" "getrandom_01=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libgetrandom-a8229ac51e36fb5e.rlib" "--extern" "getrandom_01=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libgetrandom-a8229ac51e36fb5e.rmeta" "--extern" "getrandom_02=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libgetrandom-8b27f7839949d2a0.rlib" "--extern" "getrandom_02=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libgetrandom-8b27f7839949d2a0.rmeta" "--extern" "getrandom_03=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libgetrandom-0feb860ecb36f8c5.rlib" "--extern" "getrandom_03=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libgetrandom-0feb860ecb36f8c5.rmeta" "--extern" "libc=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/liblibc-a82bdcc2319fe8dc.rlib" "--extern" "libc=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/liblibc-a82bdcc2319fe8dc.rmeta" "--extern" "num_cpus=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libnum_cpus-0fa1ddf5d5900673.rlib" "--extern" "num_cpus=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libnum_cpus-0fa1ddf5d5900673.rmeta" "--extern" "futures=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libfutures-e0728ddf458b2df4.rlib" "--extern" "futures=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libfutures-e0728ddf458b2df4.rmeta" "--extern" "page_size=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libpage_size-bf8e26b8ebcd998d.rlib" "--extern" "page_size=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libpage_size-bf8e26b8ebcd998d.rmeta" "--extern" "tempfile=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libtempfile-ba907d8e496df9fd.rlib" "--extern" "tempfile=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libtempfile-ba907d8e496df9fd.rmeta" "--extern" "tokio=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libtokio-a83f03dff5ba2ed9.rlib" "--extern" "tokio=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libtokio-a83f03dff5ba2ed9.rmeta" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/debug/deps" "--edition" "2021"

error: actual output differed from expected
Execute `./miri test --bless` to update `tests/panic/overflowing-lsh-neg.stderr` to the actual output
--- tests/panic/overflowing-lsh-neg.stderr
+++ <stderr output>
+error: internal compiler error: compiler/rustc_middle/src/mir/terminator.rs:LL:CC: Binops handled elsewhere
 
-thread 'main' ($TID) panicked at tests/panic/overflowing-lsh-neg.rs:LL:CC:
-attempt to shift left with overflow
-note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
-note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
+
+thread 'rustc' ($TID) panicked at compiler/rustc_middle/src/mir/terminator.rs:LL:CC:
+Box<dyn Any>
+stack backtrace:
+   0: std::panicking::begin_panic
+   1: <rustc_errors::diagnostic::BugAbort as rustc_errors::diagnostic::EmissionGuarantee>::emit_producing_guarantee
+   2: rustc_middle::util::bug::opt_span_bug_fmt::{closure#0}
+   3: rustc_middle::ty::context::tls::with_opt::{closure#0}
+   4: rustc_middle::ty::context::tls::with_context_opt
+   5: rustc_middle::util::bug::bug_fmt
+   6: <rustc_middle::mir::syntax::AssertKind<rustc_middle::mir::syntax::Operand>>::panic_function
+   7: <rustc_const_eval::interpret::eval_context::InterpCx<miri::machine::MiriMachine> as miri::shims::panic::EvalContextExt>::assert_panic
+   8: <rustc_const_eval::interpret::eval_context::InterpCx<miri::machine::MiriMachine> as miri::concurrency::thread::EvalContextExt>::run_threads
+   9: miri::eval::eval_entry
+  10: <miri::MiriCompilerCalls as rustc_driver_impl::Callbacks>::after_analysis
+  11: <std::thread::local::LocalKey<core::cell::Cell<*const ()>>>::with
+  12: <rustc_middle::ty::context::TyCtxt>::create_global_ctxt
+  13: rustc_interface::passes::create_and_enter_global_ctxt
+  14: std::panicking::catch_unwind
+  15: <scoped_tls::ScopedKey<rustc_span::SessionGlobals>>::set
+  16: rustc_span::create_session_globals_then
---
+Miri caused an ICE during evaluation. Here's the interpreter backtrace at the time of the panic:
+note: the place in the program where the ICE was triggered
+  --> tests/panic/overflowing-lsh-neg.rs:LL:CC
+   |
+LL |     let _n = 2i64 << -1;
+   |              ^^^^^^^^^^
+   |
+   = note: stack backtrace:
+           0: main
+               at tests/panic/overflowing-lsh-neg.rs:LL:CC
---
thread 'rustc' (35847) panicked at compiler/rustc_middle/src/mir/terminator.rs:189:18:
Box<dyn Any>
stack backtrace:
   0: std::panicking::begin_panic::<rustc_errors::ExplicitBug>
   1: <rustc_errors::diagnostic::BugAbort as rustc_errors::diagnostic::EmissionGuarantee>::emit_producing_guarantee
   2: rustc_middle::util::bug::opt_span_bug_fmt::<rustc_span::span_encoding::Span>::{closure#0}
   3: rustc_middle::ty::context::tls::with_opt::<rustc_middle::util::bug::opt_span_bug_fmt<rustc_span::span_encoding::Span>::{closure#0}, !>::{closure#0}
   4: rustc_middle::ty::context::tls::with_context_opt::<rustc_middle::ty::context::tls::with_opt<rustc_middle::util::bug::opt_span_bug_fmt<rustc_span::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
   5: rustc_middle::util::bug::bug_fmt
   6: <rustc_middle::mir::syntax::AssertKind<rustc_middle::mir::syntax::Operand>>::panic_function
   7: <rustc_const_eval::interpret::eval_context::InterpCx<miri::machine::MiriMachine> as miri::shims::panic::EvalContextExt>::assert_panic
   8: <rustc_const_eval::interpret::eval_context::InterpCx<miri::machine::MiriMachine> as miri::concurrency::thread::EvalContextExt>::run_threads
   9: miri::eval::eval_entry
  10: <miri::MiriCompilerCalls as rustc_driver_impl::Callbacks>::after_analysis
  11: <std::thread::local::LocalKey<core::cell::Cell<*const ()>>>::with::<rustc_middle::ty::context::tls::enter_context<<rustc_middle::ty::context::GlobalCtxt>::enter<rustc_interface::passes::create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2}, core::option::Option<rustc_interface::queries::Linker>>::{closure#1}, core::option::Option<rustc_interface::queries::Linker>>::{closure#0}, core::option::Option<rustc_interface::queries::Linker>>
  12: <rustc_middle::ty::context::TyCtxt>::create_global_ctxt::<core::option::Option<rustc_interface::queries::Linker>, rustc_interface::passes::create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2}>
  13: rustc_interface::passes::create_and_enter_global_ctxt::<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>
  14: std::panicking::catch_unwind::<(), core::panic::unwind_safe::AssertUnwindSafe<rustc_interface::interface::run_compiler<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}::{closure#0}>>
  15: <scoped_tls::ScopedKey<rustc_span::SessionGlobals>>::set::<rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}::{closure#0}, ()>
  16: rustc_span::create_session_globals_then::<(), rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}::{closure#0}>
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
---
Miri caused an ICE during evaluation. Here's the interpreter backtrace at the time of the panic:
note: the place in the program where the ICE was triggered
  --> tests/panic/overflowing-lsh-neg.rs:4:14
   |
LL |     let _n = 2i64 << -1;
   |              ^^^^^^^^^^
   |
   = note: stack backtrace:
           0: main
               at tests/panic/overflowing-lsh-neg.rs:4:14: 4:24
---
           7: std::panic::catch_unwind::<&dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe, i32>
               at /checkout/library/std/src/panic.rs:359:14: 359:40
           8: std::rt::lang_start_internal::{closure#0}
               at /checkout/library/std/src/rt.rs:175:24: 175:49
           9: std::panicking::catch_unwind::do_call::<{closure@std::rt::lang_start_internal::{closure#0}}, isize>
               at /checkout/library/std/src/panicking.rs:581:40: 581:43
           10: std::panicking::catch_unwind::<isize, {closure@std::rt::lang_start_internal::{closure#0}}>
               at /checkout/library/std/src/panicking.rs:544:19: 544:88
           11: std::panic::catch_unwind::<{closure@std::rt::lang_start_internal::{closure#0}}, isize>
               at /checkout/library/std/src/panic.rs:359:14: 359:40
           12: std::rt::lang_start_internal
               at /checkout/library/std/src/rt.rs:171:5: 193:7
           13: std::rt::lang_start::<()>
               at /checkout/library/std/src/rt.rs:205:5: 210:6
---
thread 'rustc' (35847) panicked at compiler/rustc_middle/src/mir/terminator.rs:189:18:
Box<dyn Any>
stack backtrace:
   0: std::panicking::begin_panic::<rustc_errors::ExplicitBug>
   1: <rustc_errors::diagnostic::BugAbort as rustc_errors::diagnostic::EmissionGuarantee>::emit_producing_guarantee
   2: rustc_middle::util::bug::opt_span_bug_fmt::<rustc_span::span_encoding::Span>::{closure#0}
   3: rustc_middle::ty::context::tls::with_opt::<rustc_middle::util::bug::opt_span_bug_fmt<rustc_span::span_encoding::Span>::{closure#0}, !>::{closure#0}
   4: rustc_middle::ty::context::tls::with_context_opt::<rustc_middle::ty::context::tls::with_opt<rustc_middle::util::bug::opt_span_bug_fmt<rustc_span::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
   5: rustc_middle::util::bug::bug_fmt
   6: <rustc_middle::mir::syntax::AssertKind<rustc_middle::mir::syntax::Operand>>::panic_function
   7: <rustc_const_eval::interpret::eval_context::InterpCx<miri::machine::MiriMachine> as miri::shims::panic::EvalContextExt>::assert_panic
   8: <rustc_const_eval::interpret::eval_context::InterpCx<miri::machine::MiriMachine> as miri::concurrency::thread::EvalContextExt>::run_threads
   9: miri::eval::eval_entry
  10: <miri::MiriCompilerCalls as rustc_driver_impl::Callbacks>::after_analysis
  11: <std::thread::local::LocalKey<core::cell::Cell<*const ()>>>::with::<rustc_middle::ty::context::tls::enter_context<<rustc_middle::ty::context::GlobalCtxt>::enter<rustc_interface::passes::create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2}, core::option::Option<rustc_interface::queries::Linker>>::{closure#1}, core::option::Option<rustc_interface::queries::Linker>>::{closure#0}, core::option::Option<rustc_interface::queries::Linker>>
  12: <rustc_middle::ty::context::TyCtxt>::create_global_ctxt::<core::option::Option<rustc_interface::queries::Linker>, rustc_interface::passes::create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2}>
  13: rustc_interface::passes::create_and_enter_global_ctxt::<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>
  14: std::panicking::catch_unwind::<(), core::panic::unwind_safe::AssertUnwindSafe<rustc_interface::interface::run_compiler<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}::{closure#0}>>
  15: <scoped_tls::ScopedKey<rustc_span::SessionGlobals>>::set::<rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}::{closure#0}, ()>
  16: rustc_span::create_session_globals_then::<(), rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}::{closure#0}>
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
---
Miri caused an ICE during evaluation. Here's the interpreter backtrace at the time of the panic:
note: the place in the program where the ICE was triggered
  --> tests/panic/overflowing-lsh-neg.rs:4:14
   |
LL |     let _n = 2i64 << -1;
   |              ^^^^^^^^^^
   |
   = note: stack backtrace:
           0: main
               at tests/panic/overflowing-lsh-neg.rs:4:14: 4:24
---
           7: std::panic::catch_unwind::<&dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe, i32>
               at /checkout/library/std/src/panic.rs:359:14: 359:40
           8: std::rt::lang_start_internal::{closure#0}
               at /checkout/library/std/src/rt.rs:175:24: 175:49
           9: std::panicking::catch_unwind::do_call::<{closure@std::rt::lang_start_internal::{closure#0}}, isize>
               at /checkout/library/std/src/panicking.rs:581:40: 581:43
           10: std::panicking::catch_unwind::<isize, {closure@std::rt::lang_start_internal::{closure#0}}>
               at /checkout/library/std/src/panicking.rs:544:19: 544:88
           11: std::panic::catch_unwind::<{closure@std::rt::lang_start_internal::{closure#0}}, isize>
               at /checkout/library/std/src/panic.rs:359:14: 359:40
           12: std::rt::lang_start_internal
               at /checkout/library/std/src/rt.rs:171:5: 193:7
           13: std::rt::lang_start::<()>
               at /checkout/library/std/src/rt.rs:205:5: 210:6
---



FAILED TEST: tests/panic/overflowing-rsh-1.rs
command: MIRI_ENV_VAR_TEST="0" MIRI_TEMP="/tmp/miri-uitest-zXyPI4" RUST_BACKTRACE="1" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/miri" "--error-format=json" "--sysroot=/checkout/obj/build/x86_64-unknown-linux-gnu/miri-sysroot" "-Dwarnings" "-Dunused" "-Ainternal_features" "-Zui-testing" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/tmp/miri_ui/0/tests/panic" "tests/panic/overflowing-rsh-1.rs" "--extern" "cfg_if=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libcfg_if-5e6b4ab63bd29e1f.rlib" "--extern" "cfg_if=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libcfg_if-5e6b4ab63bd29e1f.rmeta" "--extern" "getrandom_01=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libgetrandom-a8229ac51e36fb5e.rlib" "--extern" "getrandom_01=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libgetrandom-a8229ac51e36fb5e.rmeta" "--extern" "getrandom_02=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libgetrandom-8b27f7839949d2a0.rlib" "--extern" "getrandom_02=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libgetrandom-8b27f7839949d2a0.rmeta" "--extern" "getrandom_03=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libgetrandom-0feb860ecb36f8c5.rlib" "--extern" "getrandom_03=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libgetrandom-0feb860ecb36f8c5.rmeta" "--extern" "libc=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/liblibc-a82bdcc2319fe8dc.rlib" "--extern" "libc=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/liblibc-a82bdcc2319fe8dc.rmeta" "--extern" "num_cpus=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libnum_cpus-0fa1ddf5d5900673.rlib" "--extern" "num_cpus=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libnum_cpus-0fa1ddf5d5900673.rmeta" "--extern" "futures=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libfutures-e0728ddf458b2df4.rlib" "--extern" "futures=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libfutures-e0728ddf458b2df4.rmeta" "--extern" "page_size=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libpage_size-bf8e26b8ebcd998d.rlib" "--extern" "page_size=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libpage_size-bf8e26b8ebcd998d.rmeta" "--extern" "tempfile=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libtempfile-ba907d8e496df9fd.rlib" "--extern" "tempfile=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libtempfile-ba907d8e496df9fd.rmeta" "--extern" "tokio=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libtokio-a83f03dff5ba2ed9.rlib" "--extern" "tokio=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libtokio-a83f03dff5ba2ed9.rmeta" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/debug/deps" "--edition" "2021"

error: actual output differed from expected
Execute `./miri test --bless` to update `tests/panic/overflowing-rsh-1.stderr` to the actual output
--- tests/panic/overflowing-rsh-1.stderr
+++ <stderr output>
+error: internal compiler error: compiler/rustc_middle/src/mir/terminator.rs:LL:CC: Binops handled elsewhere
 
-thread 'main' ($TID) panicked at tests/panic/overflowing-rsh-1.rs:LL:CC:
-attempt to shift right with overflow
-note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
-note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
+
+thread 'rustc' ($TID) panicked at compiler/rustc_middle/src/mir/terminator.rs:LL:CC:
+Box<dyn Any>
+stack backtrace:
+   0: std::panicking::begin_panic
+   1: <rustc_errors::diagnostic::BugAbort as rustc_errors::diagnostic::EmissionGuarantee>::emit_producing_guarantee
+   2: rustc_middle::util::bug::opt_span_bug_fmt::{closure#0}
+   3: rustc_middle::ty::context::tls::with_opt::{closure#0}
+   4: rustc_middle::ty::context::tls::with_context_opt
+   5: rustc_middle::util::bug::bug_fmt
+   6: <rustc_middle::mir::syntax::AssertKind<rustc_middle::mir::syntax::Operand>>::panic_function
+   7: <rustc_const_eval::interpret::eval_context::InterpCx<miri::machine::MiriMachine> as miri::shims::panic::EvalContextExt>::assert_panic
+   8: <rustc_const_eval::interpret::eval_context::InterpCx<miri::machine::MiriMachine> as miri::concurrency::thread::EvalContextExt>::run_threads
+   9: miri::eval::eval_entry
+  10: <miri::MiriCompilerCalls as rustc_driver_impl::Callbacks>::after_analysis
+  11: <std::thread::local::LocalKey<core::cell::Cell<*const ()>>>::with
+  12: <rustc_middle::ty::context::TyCtxt>::create_global_ctxt
+  13: rustc_interface::passes::create_and_enter_global_ctxt
+  14: std::panicking::catch_unwind
+  15: <scoped_tls::ScopedKey<rustc_span::SessionGlobals>>::set
+  16: rustc_span::create_session_globals_then
---
+Miri caused an ICE during evaluation. Here's the interpreter backtrace at the time of the panic:
+note: the place in the program where the ICE was triggered
+  --> tests/panic/overflowing-rsh-1.rs:LL:CC
+   |
+LL |     let _n = 1i64 >> 64;
+   |              ^^^^^^^^^^
+   |
+   = note: stack backtrace:
+           0: main
+               at tests/panic/overflowing-rsh-1.rs:LL:CC
---
thread 'rustc' (35852) panicked at compiler/rustc_middle/src/mir/terminator.rs:189:18:
Box<dyn Any>
stack backtrace:
   0: std::panicking::begin_panic::<rustc_errors::ExplicitBug>
   1: <rustc_errors::diagnostic::BugAbort as rustc_errors::diagnostic::EmissionGuarantee>::emit_producing_guarantee
   2: rustc_middle::util::bug::opt_span_bug_fmt::<rustc_span::span_encoding::Span>::{closure#0}
   3: rustc_middle::ty::context::tls::with_opt::<rustc_middle::util::bug::opt_span_bug_fmt<rustc_span::span_encoding::Span>::{closure#0}, !>::{closure#0}
   4: rustc_middle::ty::context::tls::with_context_opt::<rustc_middle::ty::context::tls::with_opt<rustc_middle::util::bug::opt_span_bug_fmt<rustc_span::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
   5: rustc_middle::util::bug::bug_fmt
   6: <rustc_middle::mir::syntax::AssertKind<rustc_middle::mir::syntax::Operand>>::panic_function
   7: <rustc_const_eval::interpret::eval_context::InterpCx<miri::machine::MiriMachine> as miri::shims::panic::EvalContextExt>::assert_panic
   8: <rustc_const_eval::interpret::eval_context::InterpCx<miri::machine::MiriMachine> as miri::concurrency::thread::EvalContextExt>::run_threads
   9: miri::eval::eval_entry
  10: <miri::MiriCompilerCalls as rustc_driver_impl::Callbacks>::after_analysis
  11: <std::thread::local::LocalKey<core::cell::Cell<*const ()>>>::with::<rustc_middle::ty::context::tls::enter_context<<rustc_middle::ty::context::GlobalCtxt>::enter<rustc_interface::passes::create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2}, core::option::Option<rustc_interface::queries::Linker>>::{closure#1}, core::option::Option<rustc_interface::queries::Linker>>::{closure#0}, core::option::Option<rustc_interface::queries::Linker>>
  12: <rustc_middle::ty::context::TyCtxt>::create_global_ctxt::<core::option::Option<rustc_interface::queries::Linker>, rustc_interface::passes::create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2}>
  13: rustc_interface::passes::create_and_enter_global_ctxt::<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>
  14: std::panicking::catch_unwind::<(), core::panic::unwind_safe::AssertUnwindSafe<rustc_interface::interface::run_compiler<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}::{closure#0}>>
  15: <scoped_tls::ScopedKey<rustc_span::SessionGlobals>>::set::<rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}::{closure#0}, ()>
  16: rustc_span::create_session_globals_then::<(), rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}::{closure#0}>
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
---
Miri caused an ICE during evaluation. Here's the interpreter backtrace at the time of the panic:
note: the place in the program where the ICE was triggered
  --> tests/panic/overflowing-rsh-1.rs:4:14
   |
LL |     let _n = 1i64 >> 64;
   |              ^^^^^^^^^^
   |
   = note: stack backtrace:
           0: main
               at tests/panic/overflowing-rsh-1.rs:4:14: 4:24
---
           7: std::panic::catch_unwind::<&dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe, i32>
               at /checkout/library/std/src/panic.rs:359:14: 359:40
           8: std::rt::lang_start_internal::{closure#0}
               at /checkout/library/std/src/rt.rs:175:24: 175:49
           9: std::panicking::catch_unwind::do_call::<{closure@std::rt::lang_start_internal::{closure#0}}, isize>
               at /checkout/library/std/src/panicking.rs:581:40: 581:43
           10: std::panicking::catch_unwind::<isize, {closure@std::rt::lang_start_internal::{closure#0}}>
               at /checkout/library/std/src/panicking.rs:544:19: 544:88
           11: std::panic::catch_unwind::<{closure@std::rt::lang_start_internal::{closure#0}}, isize>
               at /checkout/library/std/src/panic.rs:359:14: 359:40
           12: std::rt::lang_start_internal
               at /checkout/library/std/src/rt.rs:171:5: 193:7
           13: std::rt::lang_start::<()>
               at /checkout/library/std/src/rt.rs:205:5: 210:6
---
thread 'rustc' (35852) panicked at compiler/rustc_middle/src/mir/terminator.rs:189:18:
Box<dyn Any>
stack backtrace:
   0: std::panicking::begin_panic::<rustc_errors::ExplicitBug>
   1: <rustc_errors::diagnostic::BugAbort as rustc_errors::diagnostic::EmissionGuarantee>::emit_producing_guarantee
   2: rustc_middle::util::bug::opt_span_bug_fmt::<rustc_span::span_encoding::Span>::{closure#0}
   3: rustc_middle::ty::context::tls::with_opt::<rustc_middle::util::bug::opt_span_bug_fmt<rustc_span::span_encoding::Span>::{closure#0}, !>::{closure#0}
   4: rustc_middle::ty::context::tls::with_context_opt::<rustc_middle::ty::context::tls::with_opt<rustc_middle::util::bug::opt_span_bug_fmt<rustc_span::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
   5: rustc_middle::util::bug::bug_fmt
   6: <rustc_middle::mir::syntax::AssertKind<rustc_middle::mir::syntax::Operand>>::panic_function
   7: <rustc_const_eval::interpret::eval_context::InterpCx<miri::machine::MiriMachine> as miri::shims::panic::EvalContextExt>::assert_panic
   8: <rustc_const_eval::interpret::eval_context::InterpCx<miri::machine::MiriMachine> as miri::concurrency::thread::EvalContextExt>::run_threads
   9: miri::eval::eval_entry
  10: <miri::MiriCompilerCalls as rustc_driver_impl::Callbacks>::after_analysis
  11: <std::thread::local::LocalKey<core::cell::Cell<*const ()>>>::with::<rustc_middle::ty::context::tls::enter_context<<rustc_middle::ty::context::GlobalCtxt>::enter<rustc_interface::passes::create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2}, core::option::Option<rustc_interface::queries::Linker>>::{closure#1}, core::option::Option<rustc_interface::queries::Linker>>::{closure#0}, core::option::Option<rustc_interface::queries::Linker>>
  12: <rustc_middle::ty::context::TyCtxt>::create_global_ctxt::<core::option::Option<rustc_interface::queries::Linker>, rustc_interface::passes::create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2}>
  13: rustc_interface::passes::create_and_enter_global_ctxt::<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>
  14: std::panicking::catch_unwind::<(), core::panic::unwind_safe::AssertUnwindSafe<rustc_interface::interface::run_compiler<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}::{closure#0}>>
  15: <scoped_tls::ScopedKey<rustc_span::SessionGlobals>>::set::<rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}::{closure#0}, ()>
  16: rustc_span::create_session_globals_then::<(), rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}::{closure#0}>
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
---
Miri caused an ICE during evaluation. Here's the interpreter backtrace at the time of the panic:
note: the place in the program where the ICE was triggered
  --> tests/panic/overflowing-rsh-1.rs:4:14
   |
LL |     let _n = 1i64 >> 64;
   |              ^^^^^^^^^^
   |
   = note: stack backtrace:
           0: main
               at tests/panic/overflowing-rsh-1.rs:4:14: 4:24
---
           7: std::panic::catch_unwind::<&dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe, i32>
               at /checkout/library/std/src/panic.rs:359:14: 359:40
           8: std::rt::lang_start_internal::{closure#0}
               at /checkout/library/std/src/rt.rs:175:24: 175:49
           9: std::panicking::catch_unwind::do_call::<{closure@std::rt::lang_start_internal::{closure#0}}, isize>
               at /checkout/library/std/src/panicking.rs:581:40: 581:43
           10: std::panicking::catch_unwind::<isize, {closure@std::rt::lang_start_internal::{closure#0}}>
               at /checkout/library/std/src/panicking.rs:544:19: 544:88
           11: std::panic::catch_unwind::<{closure@std::rt::lang_start_internal::{closure#0}}, isize>
               at /checkout/library/std/src/panic.rs:359:14: 359:40
           12: std::rt::lang_start_internal
               at /checkout/library/std/src/rt.rs:171:5: 193:7
           13: std::rt::lang_start::<()>
               at /checkout/library/std/src/rt.rs:205:5: 210:6
---



FAILED TEST: tests/panic/overflowing-rsh-2.rs
command: MIRI_ENV_VAR_TEST="0" MIRI_TEMP="/tmp/miri-uitest-zXyPI4" RUST_BACKTRACE="1" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/miri" "--error-format=json" "--sysroot=/checkout/obj/build/x86_64-unknown-linux-gnu/miri-sysroot" "-Dwarnings" "-Dunused" "-Ainternal_features" "-Zui-testing" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/tmp/miri_ui/0/tests/panic" "tests/panic/overflowing-rsh-2.rs" "--extern" "cfg_if=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libcfg_if-5e6b4ab63bd29e1f.rlib" "--extern" "cfg_if=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libcfg_if-5e6b4ab63bd29e1f.rmeta" "--extern" "getrandom_01=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libgetrandom-a8229ac51e36fb5e.rlib" "--extern" "getrandom_01=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libgetrandom-a8229ac51e36fb5e.rmeta" "--extern" "getrandom_02=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libgetrandom-8b27f7839949d2a0.rlib" "--extern" "getrandom_02=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libgetrandom-8b27f7839949d2a0.rmeta" "--extern" "getrandom_03=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libgetrandom-0feb860ecb36f8c5.rlib" "--extern" "getrandom_03=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libgetrandom-0feb860ecb36f8c5.rmeta" "--extern" "libc=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/liblibc-a82bdcc2319fe8dc.rlib" "--extern" "libc=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/liblibc-a82bdcc2319fe8dc.rmeta" "--extern" "num_cpus=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libnum_cpus-0fa1ddf5d5900673.rlib" "--extern" "num_cpus=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libnum_cpus-0fa1ddf5d5900673.rmeta" "--extern" "futures=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libfutures-e0728ddf458b2df4.rlib" "--extern" "futures=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libfutures-e0728ddf458b2df4.rmeta" "--extern" "page_size=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libpage_size-bf8e26b8ebcd998d.rlib" "--extern" "page_size=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libpage_size-bf8e26b8ebcd998d.rmeta" "--extern" "tempfile=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libtempfile-ba907d8e496df9fd.rlib" "--extern" "tempfile=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libtempfile-ba907d8e496df9fd.rmeta" "--extern" "tokio=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libtokio-a83f03dff5ba2ed9.rlib" "--extern" "tokio=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps/libtokio-a83f03dff5ba2ed9.rmeta" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/deps" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/debug/deps" "--edition" "2021"

error: actual output differed from expected
Execute `./miri test --bless` to update `tests/panic/overflowing-rsh-2.stderr` to the actual output
--- tests/panic/overflowing-rsh-2.stderr
+++ <stderr output>
+error: internal compiler error: compiler/rustc_middle/src/mir/terminator.rs:LL:CC: Binops handled elsewhere
 
-thread 'main' ($TID) panicked at tests/panic/overflowing-rsh-2.rs:LL:CC:
-attempt to shift right with overflow
-note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
-note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
+
+thread 'rustc' ($TID) panicked at compiler/rustc_middle/src/mir/terminator.rs:LL:CC:
+Box<dyn Any>
+stack backtrace:
+   0: std::panicking::begin_panic
+   1: <rustc_errors::diagnostic::BugAbort as rustc_errors::diagnostic::EmissionGuarantee>::emit_producing_guarantee
+   2: rustc_middle::util::bug::opt_span_bug_fmt::{closure#0}
+   3: rustc_middle::ty::context::tls::with_opt::{closure#0}
+   4: rustc_middle::ty::context::tls::with_context_opt
+   5: rustc_middle::util::bug::bug_fmt
+   6: <rustc_middle::mir::syntax::AssertKind<rustc_middle::mir::syntax::Operand>>::panic_function
+   7: <rustc_const_eval::interpret::eval_context::InterpCx<miri::machine::MiriMachine> as miri::shims::panic::EvalContextExt>::assert_panic
+   8: <rustc_const_eval::interpret::eval_context::InterpCx<miri::machine::MiriMachine> as miri::concurrency::thread::EvalContextExt>::run_threads
+   9: miri::eval::eval_entry
+  10: <miri::MiriCompilerCalls as rustc_driver_impl::Callbacks>::after_analysis
+  11: <std::thread::local::LocalKey<core::cell::Cell<*const ()>>>::with
+  12: <rustc_middle::ty::context::TyCtxt>::create_global_ctxt
+  13: rustc_interface::passes::create_and_enter_global_ctxt
+  14: std::panicking::catch_unwind
+  15: <scoped_tls::ScopedKey<rustc_span::SessionGlobals>>::set
+  16: rustc_span::create_session_globals_then
---
+Miri caused an ICE during evaluation. Here's the interpreter backtrace at the time of the panic:
+note: the place in the program where the ICE was triggered
+  --> tests/panic/overflowing-rsh-2.rs:LL:CC
+   |
+LL |     let _n = 1i64 >> (u32::MAX as i64 + 1);
+   |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: stack backtrace:
+           0: main
+               at tests/panic/overflowing-rsh-2.rs:LL:CC
---
thread 'rustc' (35855) panicked at compiler/rustc_middle/src/mir/terminator.rs:189:18:
Box<dyn Any>
stack backtrace:
   0: std::panicking::begin_panic::<rustc_errors::ExplicitBug>
   1: <rustc_errors::diagnostic::BugAbort as rustc_errors::diagnostic::EmissionGuarantee>::emit_producing_guarantee
   2: rustc_middle::util::bug::opt_span_bug_fmt::<rustc_span::span_encoding::Span>::{closure#0}
   3: rustc_middle::ty::context::tls::with_opt::<rustc_middle::util::bug::opt_span_bug_fmt<rustc_span::span_encoding::Span>::{closure#0}, !>::{closure#0}
   4: rustc_middle::ty::context::tls::with_context_opt::<rustc_middle::ty::context::tls::with_opt<rustc_middle::util::bug::opt_span_bug_fmt<rustc_span::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
   5: rustc_middle::util::bug::bug_fmt
   6: <rustc_middle::mir::syntax::AssertKind<rustc_middle::mir::syntax::Operand>>::panic_function
   7: <rustc_const_eval::interpret::eval_context::InterpCx<miri::machine::MiriMachine> as miri::shims::panic::EvalContextExt>::assert_panic
   8: <rustc_const_eval::interpret::eval_context::InterpCx<miri::machine::MiriMachine> as miri::concurrency::thread::EvalContextExt>::run_threads
   9: miri::eval::eval_entry
  10: <miri::MiriCompilerCalls as rustc_driver_impl::Callbacks>::after_analysis
  11: <std::thread::local::LocalKey<core::cell::Cell<*const ()>>>::with::<rustc_middle::ty::context::tls::enter_context<<rustc_middle::ty::context::GlobalCtxt>::enter<rustc_interface::passes::create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2}, core::option::Option<rustc_interface::queries::Linker>>::{closure#1}, core::option::Option<rustc_interface::queries::Linker>>::{closure#0}, core::option::Option<rustc_interface::queries::Linker>>
  12: <rustc_middle::ty::context::TyCtxt>::create_global_ctxt::<core::option::Option<rustc_interface::queries::Linker>, rustc_interface::passes::create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2}>
  13: rustc_interface::passes::create_and_enter_global_ctxt::<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>
  14: std::panicking::catch_unwind::<(), core::panic::unwind_safe::AssertUnwindSafe<rustc_interface::interface::run_compiler<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}::{closure#0}>>
  15: <scoped_tls::ScopedKey<rustc_span::SessionGlobals>>::set::<rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}::{closure#0}, ()>
  16: rustc_span::create_session_globals_then::<(), rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}::{closure#0}>
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
---
Miri caused an ICE during evaluation. Here's the interpreter backtrace at the time of the panic:
note: the place in the program where the ICE was triggered
  --> tests/panic/overflowing-rsh-2.rs:5:14
   |
LL |     let _n = 1i64 >> (u32::MAX as i64 + 1);
   |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: stack backtrace:
           0: main
               at tests/panic/overflowing-rsh-2.rs:5:14: 5:43
---
           7: std::panic::catch_unwind::<&dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe, i32>
               at /checkout/library/std/src/panic.rs:359:14: 359:40
           8: std::rt::lang_start_internal::{closure#0}
               at /checkout/library/std/src/rt.rs:175:24: 175:49
           9: std::panicking::catch_unwind::do_call::<{closure@std::rt::lang_start_internal::{closure#0}}, isize>
               at /checkout/library/std/src/panicking.rs:581:40: 581:43
           10: std::panicking::catch_unwind::<isize, {closure@std::rt::lang_start_internal::{closure#0}}>
               at /checkout/library/std/src/panicking.rs:544:19: 544:88
           11: std::panic::catch_unwind::<{closure@std::rt::lang_start_internal::{closure#0}}, isize>
               at /checkout/library/std/src/panic.rs:359:14: 359:40
           12: std::rt::lang_start_internal
               at /checkout/library/std/src/rt.rs:171:5: 193:7
           13: std::rt::lang_start::<()>
               at /checkout/library/std/src/rt.rs:205:5: 210:6
---
thread 'rustc' (35855) panicked at compiler/rustc_middle/src/mir/terminator.rs:189:18:
Box<dyn Any>
stack backtrace:
   0: std::panicking::begin_panic::<rustc_errors::ExplicitBug>
   1: <rustc_errors::diagnostic::BugAbort as rustc_errors::diagnostic::EmissionGuarantee>::emit_producing_guarantee
   2: rustc_middle::util::bug::opt_span_bug_fmt::<rustc_span::span_encoding::Span>::{closure#0}
   3: rustc_middle::ty::context::tls::with_opt::<rustc_middle::util::bug::opt_span_bug_fmt<rustc_span::span_encoding::Span>::{closure#0}, !>::{closure#0}
   4: rustc_middle::ty::context::tls::with_context_opt::<rustc_middle::ty::context::tls::with_opt<rustc_middle::util::bug::opt_span_bug_fmt<rustc_span::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
   5: rustc_middle::util::bug::bug_fmt
   6: <rustc_middle::mir::syntax::AssertKind<rustc_middle::mir::syntax::Operand>>::panic_function
   7: <rustc_const_eval::interpret::eval_context::InterpCx<miri::machine::MiriMachine> as miri::shims::panic::EvalContextExt>::assert_panic
   8: <rustc_const_eval::interpret::eval_context::InterpCx<miri::machine::MiriMachine> as miri::concurrency::thread::EvalContextExt>::run_threads
   9: miri::eval::eval_entry
  10: <miri::MiriCompilerCalls as rustc_driver_impl::Callbacks>::after_analysis
  11: <std::thread::local::LocalKey<core::cell::Cell<*const ()>>>::with::<rustc_middle::ty::context::tls::enter_context<<rustc_middle::ty::context::GlobalCtxt>::enter<rustc_interface::passes::create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2}, core::option::Option<rustc_interface::queries::Linker>>::{closure#1}, core::option::Option<rustc_interface::queries::Linker>>::{closure#0}, core::option::Option<rustc_interface::queries::Linker>>
  12: <rustc_middle::ty::context::TyCtxt>::create_global_ctxt::<core::option::Option<rustc_interface::queries::Linker>, rustc_interface::passes::create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2}>
  13: rustc_interface::passes::create_and_enter_global_ctxt::<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>
  14: std::panicking::catch_unwind::<(), core::panic::unwind_safe::AssertUnwindSafe<rustc_interface::interface::run_compiler<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}::{closure#0}>>
  15: <scoped_tls::ScopedKey<rustc_span::SessionGlobals>>::set::<rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}::{closure#0}, ()>
  16: rustc_span::create_session_globals_then::<(), rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}::{closure#0}>
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
---
Miri caused an ICE during evaluation. Here's the interpreter backtrace at the time of the panic:
note: the place in the program where the ICE was triggered
  --> tests/panic/overflowing-rsh-2.rs:5:14
   |
LL |     let _n = 1i64 >> (u32::MAX as i64 + 1);
   |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: stack backtrace:
           0: main
               at tests/panic/overflowing-rsh-2.rs:5:14: 5:43
---
           7: std::panic::catch_unwind::<&dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe, i32>
               at /checkout/library/std/src/panic.rs:359:14: 359:40
           8: std::rt::lang_start_internal::{closure#0}
               at /checkout/library/std/src/rt.rs:175:24: 175:49
           9: std::panicking::catch_unwind::do_call::<{closure@std::rt::lang_start_internal::{closure#0}}, isize>
               at /checkout/library/std/src/panicking.rs:581:40: 581:43
           10: std::panicking::catch_unwind::<isize, {closure@std::rt::lang_start_internal::{closure#0}}>
               at /checkout/library/std/src/panicking.rs:544:19: 544:88
           11: std::panic::catch_unwind::<{closure@std::rt::lang_start_internal::{closure#0}}, isize>
               at /checkout/library/std/src/panic.rs:359:14: 359:40
           12: std::rt::lang_start_internal
               at /checkout/library/std/src/rt.rs:171:5: 193:7
           13: std::rt::lang_start::<()>
               at /checkout/library/std/src/rt.rs:205:5: 210:6
---
Location:
   /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/ui_test-0.30.3/src/lib.rs:365

  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   1: <color_eyre[1059d61b5efc1221]::config::EyreHook>::into_eyre_hook::{closure#0}<unknown>
      at <unknown source file>:<unknown line>
   2: <eyre[b3ed9720e21db5ce]::Report>::from_adhoc::<&str><unknown>
      at <unknown source file>:<unknown line>
   3: ui_test[29f2bf0126f77084]::run_tests_generic::<ui_test[29f2bf0126f77084]::default_file_filter, ui[c35c8c6185ebef80]::run_tests::{closure#1}, alloc[dc1559d3104b32b3]::boxed::Box<dyn ui_test[29f2bf0126f77084]::status_emitter::StatusEmitter>><unknown>
      at <unknown source file>:<unknown line>
   4: ui[c35c8c6185ebef80]::ui<unknown>
      at <unknown source file>:<unknown line>
   5: ui[c35c8c6185ebef80]::main<unknown>
      at <unknown source file>:<unknown line>
   6: std[69836078a8ff85c7]::sys::backtrace::__rust_begin_short_backtrace::<fn() -> core[65daf6557a33a8fe]::result::Result<(), eyre[b3ed9720e21db5ce]::Report>, core[65daf6557a33a8fe]::result::Result<(), eyre[b3ed9720e21db5ce]::Report>><unknown>
      at <unknown source file>:<unknown line>
   7: std[69836078a8ff85c7]::rt::lang_start::<core[65daf6557a33a8fe]::result::Result<(), eyre[b3ed9720e21db5ce]::Report>>::{closure#0}<unknown>
      at <unknown source file>:<unknown line>
   8: std[69836078a8ff85c7]::rt::lang_start_internal<unknown>
      at <unknown source file>:<unknown line>
   9: main<unknown>
      at <unknown source file>:<unknown line>
  10: __libc_start_main<unknown>
      at <unknown source file>:<unknown line>
  11: _start<unknown>
      at <unknown source file>:<unknown line>

Run with COLORBT_SHOW_HIDDEN=1 environment variable to disable frame filtering.
Run with RUST_BACKTRACE=full to include source snippets.
error: test failed, to rerun pass `--test ui`

Caused by:
  process didn't exit successfully: `/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/ui-967339ea3dcc1e54` (exit status: 1)
Command `/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo test -Zwarnings --target x86_64-unknown-linux-gnu -Zbinary-dep-depinfo -j 4 -Zroot-dir=/checkout --locked --color=always --profile=release --manifest-path /checkout/src/tools/miri/Cargo.toml -- [workdir=/checkout]` failed with exit code 1
Created at: src/bootstrap/src/core/build_steps/tool.rs:191:21
Executed at: src/bootstrap/src/core/build_steps/test.rs:739:19

--- BACKTRACE vvv
   0: <bootstrap::utils::exec::DeferredCommand>::finish_process
             at /checkout/src/bootstrap/src/utils/exec.rs:939:17
   1: <bootstrap::utils::exec::DeferredCommand>::wait_for_output::<&bootstrap::utils::exec::ExecutionContext>
             at /checkout/src/bootstrap/src/utils/exec.rs:831:21
   2: <bootstrap::utils::exec::ExecutionContext>::run
             at /checkout/src/bootstrap/src/utils/exec.rs:741:45
   3: <bootstrap::utils::exec::BootstrapCommand>::run::<&bootstrap::core::builder::Builder>
             at /checkout/src/bootstrap/src/utils/exec.rs:339:27
   4: <bootstrap::core::build_steps::test::Miri as bootstrap::core::builder::Step>::run
             at /checkout/src/bootstrap/src/core/build_steps/test.rs:739:19
   5: <bootstrap::core::builder::Builder>::ensure::<bootstrap::core::build_steps::test::Miri>
             at /checkout/src/bootstrap/src/core/builder/mod.rs:1579:36
   6: <bootstrap::core::build_steps::test::Miri as bootstrap::core::builder::Step>::make_run
             at /checkout/src/bootstrap/src/core/build_steps/test.rs:665:21
   7: <bootstrap::core::builder::StepDescription>::maybe_run
             at /checkout/src/bootstrap/src/core/builder/mod.rs:476:13
   8: bootstrap::core::builder::cli_paths::match_paths_to_steps_and_run
             at /checkout/src/bootstrap/src/core/builder/cli_paths.rs:232:18
   9: <bootstrap::core::builder::Builder>::run_step_descriptions
             at /checkout/src/bootstrap/src/core/builder/mod.rs:1122:9
  10: <bootstrap::core::builder::Builder>::execute_cli
             at /checkout/src/bootstrap/src/core/builder/mod.rs:1101:14
  11: <bootstrap::Build>::build
             at /checkout/src/bootstrap/src/lib.rs:799:25
  12: bootstrap::main
             at /checkout/src/bootstrap/src/bin/main.rs:130:11
  13: <fn() as core::ops::function::FnOnce<()>>::call_once
             at /rustc/ad726b5063362ec9897ef3d67452fc5606ee70fa/library/core/src/ops/function.rs:250:5
  14: std::sys::backtrace::__rust_begin_short_backtrace::<fn(), ()>
             at /rustc/ad726b5063362ec9897ef3d67452fc5606ee70fa/library/std/src/sys/backtrace.rs:166:18
  15: std::rt::lang_start::<()>::{closure#0}
             at /rustc/ad726b5063362ec9897ef3d67452fc5606ee70fa/library/std/src/rt.rs:206:18
  16: <&dyn core::ops::function::Fn<(), Output = i32> + core::panic::unwind_safe::RefUnwindSafe + core::marker::Sync as core::ops::function::FnOnce<()>>::call_once
             at /rustc/ad726b5063362ec9897ef3d67452fc5606ee70fa/library/core/src/ops/function.rs:287:21
  17: std::panicking::catch_unwind::do_call::<&dyn core::ops::function::Fn<(), Output = i32> + core::panic::unwind_safe::RefUnwindSafe + core::marker::Sync, i32>
             at /rustc/ad726b5063362ec9897ef3d67452fc5606ee70fa/library/std/src/panicking.rs:581:40
  18: std::panicking::catch_unwind::<i32, &dyn core::ops::function::Fn<(), Output = i32> + core::panic::unwind_safe::RefUnwindSafe + core::marker::Sync>
             at /rustc/ad726b5063362ec9897ef3d67452fc5606ee70fa/library/std/src/panicking.rs:544:19
  19: std::panic::catch_unwind::<&dyn core::ops::function::Fn<(), Output = i32> + core::panic::unwind_safe::RefUnwindSafe + core::marker::Sync, i32>
             at /rustc/ad726b5063362ec9897ef3d67452fc5606ee70fa/library/std/src/panic.rs:359:14
  20: std::rt::lang_start_internal::{closure#0}
             at /rustc/ad726b5063362ec9897ef3d67452fc5606ee70fa/library/std/src/rt.rs:175:24
  21: std::panicking::catch_unwind::do_call::<std::rt::lang_start_internal::{closure#0}, isize>
             at /rustc/ad726b5063362ec9897ef3d67452fc5606ee70fa/library/std/src/panicking.rs:581:40
---
  28: __libc_start_main
  29: _start


Command has failed. Rerun with -v to see more details.
Bootstrap failed while executing `test --stage 2 src/tools/miri src/tools/miri/cargo-miri`
Build completed unsuccessfully in 0:48:10
  local time: Mon Mar 23 01:38:17 UTC 2026
  network time: Mon, 23 Mar 2026 01:38:17 GMT
##[error]Process completed with exit code 1.

@Noratrieb
Copy link
Copy Markdown
Member

FWIW I don't think rustc-perf is any useful here. The compiler is currently compile with overflow-checks disabled and any benchmarks like this mix potential overhead at runtime from having to spend more time compiling. As such rustc-perf compile-time benchmarks can't really be used meaningfully here.

I don't think we have a good substitute out-of-the-box.

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors bot commented Mar 23, 2026

☔ The latest upstream changes (presumably #154253) made this pull request unmergeable. Please resolve the merge conflicts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

perf-regression Performance regression. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants